import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Graphics;

public class Exit extends Canvas{
	private Display display;
	private MainMenu mainmenu;
	private GameMIDlet midlet;
	public Exit(GameMIDlet midlet, MainMenu mainmenu, Display display){
		this.display = display;
		this.mainmenu = mainmenu;
		this.midlet = midlet;
		setFullScreenMode(true);
	}
	public void paint(Graphics g){
		if(Option.language == true){
			g.setColor(255, 255, 255);
			g.fillRect(0, 0, 128, 160);			
			g.setColor(0, 0, 0);
			//g.drawLine(64,0,64,160);
			g.drawString("Thoat Game ?", 33,55, 0);
			g.drawString("Co", 2, 145, 0);
			g.drawString("Khong", 96, 145, 0);
		}
		else{
			g.setColor(255, 255, 255);
			g.fillRect(0, 0, 128, 160);
			g.setColor(0, 0, 0);
			//g.drawLine(64,0,64,160);
			g.drawString("Exit Game ?", 40, 55, 0);	
			g.drawString("Yes", 2, 145, 0);
			g.drawString("No", 114, 145, 0);
		}
	}
	protected void keyPressed(int code){
		if(code == -6)
			midlet.exit();		
		if(code == -7)
			display.setCurrent(mainmenu);
	}
}